<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>美兰数据文化馆与图书馆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/formSelects-v4.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" lay-filter="component-form-element">
                <input type="hidden" name="tid">
                <div class="layui-tab-content" style="height: auto">
                    <div class="layui-tab-item layui-show" id="onecontent">
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">账号</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="username" lay-verify="username"
                                               autocomplete="off" placeholder="请输入账号"
                                               class="layui-input" disabled>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">用户名</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="name"
                                               autocomplete="off" placeholder="请输入用户名"
                                               class="layui-input" lay-verify="name" disabled>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">联系方式</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="phone"
                                               autocomplete="off" placeholder="请输入联系方式"
                                               class="layui-input" lay-verify="phone" disabled>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">所属部门</label>
                                    <div class="layui-input-block">
                                        <select name="depTid" xm-select="depTid" xm-select-search="" disabled>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
<%--                        <div class="layui-form-item">--%>
<%--                            <div class="layui-col-lg6">--%>
<%--                                <div class="layui-col-xs11">--%>
<%--                                    <label class="layui-form-label">职务</label>--%>
<%--                                    <div class="layui-input-block">--%>
<%--                                        <select name="positionTid" xm-select="positionTid" xm-select-search=""--%>
<%--                                                xm-select-radio="" disabled>--%>
<%--                                        </select>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                            </div>--%>
<%--                        </div>--%>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">性别</label>
                                    <div class="layui-input-block">
                                        <input type="radio" name="sex" value="男" title="男" disabled>
                                        <input type="radio" name="sex" value="女" title="女" disabled>
                                        <input type="radio" name="sex" value="保密" title="保密" disabled>
                                    </div>
                                </div>
                            </div>
                        </div>
<%--                        <div class="layui-form-item">--%>
<%--                            <div class="layui-col-lg6">--%>
<%--                                <div class="layui-col-xs6">--%>
<%--                                    <label class="layui-form-label">初始密码</label>--%>
<%--                                    <div class="layui-input-block">--%>
<%--                                        <input type="password" name="password" lay-verify="password"--%>
<%--                                               placeholder="请输入密码" autocomplete="off" class="layui-input"--%>
<%--                                               disabled>--%>
<%--                                    </div>--%>
<%--                                </div>--%>
<%--                                <div class="layui-col-xs6">--%>
<%--                                    <div class="layui-form-mid layui-word-aux"--%>
<%--                                         style="color: red !important;padding: 9px !important;">*--%>
<%--                                    </div>--%>
<%--                                    <div class="layui-form-mid layui-word-aux">默认初始密码为123456</div>--%>
<%--                                </div>--%>
<%--                            </div>--%>
<%--                        </div>--%>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-block">
                                        <input type="checkbox" checked="" name="state" lay-skin="switch"
                                               lay-filter="switchTest" lay-text="正常|禁止" disabled>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-col-lg6">
                                <div class="layui-col-xs11">
                                    <label class="layui-form-label">备注</label>
                                    <div class="layui-input-block">
                                            <textarea class="layui-textarea" name="remarks"
                                                      placeholder="请输入备注" disabled></textarea>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    function child(tid) {
        layui.use(['form', 'laydate','formSelects'], function () {
            var $ = layui.$
                , form = layui.form
                , laydate = layui.laydate
                , layer = layui.layer
                , formSelects = layui.formSelects;

            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/system/getDepartmentList",
                dataType: "json",
                async: false,
                success: function (msg) {
                    formSelects.data('depTid', 'local', {
                        arr: msg
                    });
                }
            })

            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/system/getPosition",
                dataType: "json",
                async: false,
                success: function (obj) {
                    formSelects.data('positionTid', 'local', {
                        arr: obj
                    });
                }
            })



            $.ajax({
                type: "post",
                url: "<%=request.getContextPath()%>/rest/system/getUserByTid",
                dataType: "json",
                data: "tid=" + tid,
                async: false,
                success: function (data) {
                    formSelects.value('depTid', data.depList);
                    formSelects.value('positionTid', data.positionList);
                    form.val("component-form-element", data)
                    form.render('select');
                }
            })

        });
    }
</script>
</body>
</html>